cmake_minimum_required(VERSION 2.6)

# First we define what are the source files
file(
    GLOB_RECURSE
    source_files
    ./*.cpp
    )
# and header files
file(
    GLOB_RECURSE
    header_files
    ./*.hpp
    )

# We add POCO C++ to our build environment
find_package(Poco REQUIRED)
include_directories(${POCO_INCLUDE_DIR})
if (CMAKE_SYSTEM MATCHES "Darwin")

set(POCO_LIBRARIES  ${POCO_FOUNDATION} 
                    ${POCO_NET_LIBRARY} 
                    ${POCO_UTIL_LIBRARY}
                    ${POCO_NET_SSL_LIBRARY}
                    #${POCO_CRYPTO_LIBRARY}
                    )
else (CMAKE_SYSTEM MATCHES "Darwin")
set(POCO_LIBRARIES  ${POCO_FOUNDATION} 
                    ${POCO_NET_LIBRARY} 
                    ${POCO_UTIL_LIBRARY}
                    ${POCO_NET_SSL_LIBRARY}
                    ${POCO_CRYPTO_LIBRARY}
                    )

endif(CMAKE_SYSTEM MATCHES "Darwin")

set(Boost_USE_STATIC_LIBS   ON)
set(Boost_USE_MULTITHREADED ON)
find_package( Boost 1.34 COMPONENTS regex)

link_directories ( ${Boost_LIBRARY_DIRS} )
include_directories ( ${Boost_INCLUDE_DIRS} )

add_library(
    socialbox
    SHARED
    ${source_files}
    )

target_link_libraries(
    socialbox
    ${POCO_LIBRARIES}
    ${Boost_LIBRARIES}
    )
